package com.broada.apm.logic.impl;

import java.util.ArrayList;
import java.util.List;

import com.broada.apm.base.BaseLogic;
import com.broada.apm.entity.TransactionChannel;
import com.broada.apm.entity.convert.BeanConvert;
import com.broada.apm.logic.TransactionLogic;
import com.broada.apm.model.TransactionType;

public class TransactionLogicImpl extends BaseLogic implements TransactionLogic {

	@Override
	public List<TransactionChannel> getTransactionChannelByAppId(String appId) {
		List<TransactionChannel> transactionChannel = new ArrayList<TransactionChannel>();
		List<com.broada.apm.model.TransactionChannel> channelList = transactionService.getTransactionChannelByAppId(appId);
		if (channelList.size() > 0) {
			transactionChannel = BeanConvert.convertTransactionChannel(channelList);
		}
		return transactionChannel;
	}

	@Override
	public List<com.broada.apm.entity.TransactionType> getTransactionTypeByAppId(String appId) {
		List<com.broada.apm.entity.TransactionType> transactionType = new ArrayList<com.broada.apm.entity.TransactionType>();
		List<TransactionType> typeList = transactionService.getTransactionTypeByAppId(appId);
		if (typeList.size() > 0) {
			transactionType = BeanConvert.convertTransactionType(typeList);
		}
		return transactionType;
	}

}
